@extends( 'layout.home' )
@section( 'content' )
    <style>
        table.list_tab tr td a {
            margin-right: 0px;
            float: none;
        }
    </style>
    <!--面包屑导航 开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="#">首页</a> &raquo; 月租管理 &raquo; 月租列表
        <span style="float:right;margin-right: 25px;cursor:pointer;" onclick="window.location.reload();"><i class="fa fa-refresh"></i> 刷新</span>
    </div>


    <!--搜索结果页面 列表 开始-->
    <form action="#" method="post">

        <div class="result_wrap">
            <div class="result_content">
                <table class="list_tab">
                    <thead>
                    <tr>
                        <th class="tc" width="8%">ID</th>
                        <th class="tc" width="8%">车牌号</th>
                        <th class="tc" width="8%">车类型</th>
                        <th class="tc" width="8%">车主</th>
                        <th class="tc" width="8%">手机</th>
                        <th class="tc" width="20%">租期</th>
                        <th class="tc" width="8%">租期时长</th>
                        <th class="tc" width="8%">车位编号</th>
                        <th class="tc" width="8%">车位状态</th>
                        <th class="tc" width="8%">经办人</th>
                        <th class="tc" width="8%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($data as $v)
                        <tr>
                            <td class="tc">{{$v['order_id']}}</td>
                            <td class="tc">{{$v['carcity']}} · {{$v['plate_num']}}</td>
                            <td class="tc">
                                @if($v['plate_type']==1)小车
                                @elseif($v['plate_type']==2)客车/货车
                                @endif
                            </td>
                            <td class="tc">
                                {{$v['carname']}}</td>
                            </td>
                            <td class="tc">
                                {{$v['carphone']}}</td>
                            </td>
                            <td class="tc">
                                {{$v['rentstart']}} 至 {{$v['rentend']}}
                            </td>
                            <td class="tc">
                                {{$v['duration']}} 个月</td>
                            </td>
                            <td class="tc">NO.{{$v['parkingspace_no']}}</td>
                            <td class="tc">
                                @if($v['status'])
                                    {{$v['carcity']}} · {{$v['plate_num']}} 停泊中
                                @else
                                    已驶出
                                @endif
                            </td>
                            <td class="tc">{{$v['operator']}}</td>
                            <td class="tc"><a href="javascript:;" onclick="renewal({{$v['id']}})">续租</a></td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </form>
    <script src="https://cdn.bootcss.com/layer/3.1.0/layer.js"></script>
    <!--搜索结果页面 列表 结束-->
    <script>
        function renewal($rentid){//续租
            layer.open({
                type: 2,
                title:'续租',
                area: ['700px', '450px'],
                fixed: false, //不固定
                maxmin: true,
                content: '{{url('renewal')}}/'+$rentid
            });
        }
    </script>
@endsection
